<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MagTwin: logger/include/logger.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">MagTwin<span id="projectnumber">&#160;V0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_e546037d539dab48998ac54ab76cb525.html">logger</a></li><li class="navelem"><a class="el" href="dir_2a3cdfb6bd04ba43745e2c2b16e04b68.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">logger.h</div></div>
</div><!--header-->
<div class="contents">
<a href="logger_2include_2logger_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#ifndef LOGGER_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#define LOGGER_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#include &lt;ctime&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &lt;sstream&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#include &lt;iomanip&gt;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#include &lt;fstream&gt;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="keyword">class </span><a class="code hl_class" href="class_mag_logger.html">MagLogger</a> {</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="class_mag_logger.html#af874833bef5967536c000746eed82900">   32</a></span>    <a class="code hl_function" href="class_mag_logger.html#af874833bef5967536c000746eed82900">MagLogger</a>() {}</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="class_mag_logger.html#ad13cbdf4b33a580b1096aee2aa9a4030">   38</a></span>    <a class="code hl_function" href="class_mag_logger.html#ad13cbdf4b33a580b1096aee2aa9a4030">~MagLogger</a>() {}</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="class_mag_logger.html#aeca59a7fe42b816420492621efd4cbb9">   45</a></span>    std::string <a class="code hl_function" href="class_mag_logger.html#aeca59a7fe42b816420492621efd4cbb9">currentTime</a>();</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="class_mag_logger.html#aa52e41fe1302a56ec26856cd062b291f">   52</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_mag_logger.html#aa52e41fe1302a56ec26856cd062b291f">debug</a>(<span class="keyword">const</span> std::string&amp; message);</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="class_mag_logger.html#adc2763b218ec03d8ecbb6bf00cc64a28">   59</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_mag_logger.html#adc2763b218ec03d8ecbb6bf00cc64a28">info</a>(<span class="keyword">const</span> std::string&amp; message);</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="class_mag_logger.html#abacc186e35e7a98e37edd8981c19454d">   66</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_mag_logger.html#abacc186e35e7a98e37edd8981c19454d">warning</a>(<span class="keyword">const</span> std::string&amp; message);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="class_mag_logger.html#a4dc582a17edb8e04890939de3be12880">   73</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_mag_logger.html#a4dc582a17edb8e04890939de3be12880">error</a>(<span class="keyword">const</span> std::string&amp; message);</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="class_mag_logger.html#a8f2476196fafaf6bd65c9da863a7d059">   80</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_mag_logger.html#a8f2476196fafaf6bd65c9da863a7d059">fatal</a>(<span class="keyword">const</span> std::string&amp; message);</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="class_mag_logger.html#a7daa71a421f3faf8c8814d4e0e9b80cf">   87</a></span>    std::vector&lt;std::string&gt;&amp; <a class="code hl_function" href="class_mag_logger.html#a7daa71a421f3faf8c8814d4e0e9b80cf">getDebugLog</a>() { <span class="keywordflow">return</span> debugLog; }</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="class_mag_logger.html#a46cb6161a2e36801ca084e93bc9d9f0c">   94</a></span>    std::vector&lt;std::string&gt;&amp; <a class="code hl_function" href="class_mag_logger.html#a46cb6161a2e36801ca084e93bc9d9f0c">getInfoLog</a>() { <span class="keywordflow">return</span> infoLog; }</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="class_mag_logger.html#ab2a8c008b8c2c0236fe45d7978600d7d">  101</a></span>    std::vector&lt;std::string&gt;&amp; <a class="code hl_function" href="class_mag_logger.html#ab2a8c008b8c2c0236fe45d7978600d7d">getWarningLog</a>() { <span class="keywordflow">return</span> warningLog; }</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"><a class="line" href="class_mag_logger.html#aa729d5403639328551ad7e2ec3f210e6">  108</a></span>    std::vector&lt;std::string&gt;&amp; <a class="code hl_function" href="class_mag_logger.html#aa729d5403639328551ad7e2ec3f210e6">getErrorLog</a>() { <span class="keywordflow">return</span> errorLog; }</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="class_mag_logger.html#a90b8b90bf5ac841eb406f74c015d72b3">  115</a></span>    std::vector&lt;std::string&gt;&amp; <a class="code hl_function" href="class_mag_logger.html#a90b8b90bf5ac841eb406f74c015d72b3">getFatalLog</a>() { <span class="keywordflow">return</span> fatalLog; }</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="class_mag_logger.html#a463c08ad83b7ce61634ce61f2c653b2a">  122</a></span>    std::vector&lt;std::string&gt;&amp; <a class="code hl_function" href="class_mag_logger.html#a463c08ad83b7ce61634ce61f2c653b2a">getAllLog</a>() { <span class="keywordflow">return</span> magAllLog; }</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="class_mag_logger.html#a871395cc8d7389bdf827cc610f3c236a">  130</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_mag_logger.html#a871395cc8d7389bdf827cc610f3c236a">exportLog</a>(<span class="keyword">const</span> std::string&amp; fileName);</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span>    std::vector&lt;std::string&gt; magAllLog;</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno">  133</span>    std::vector&lt;std::string&gt; debugLog;</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno">  134</span>    std::vector&lt;std::string&gt; infoLog;</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span>    std::vector&lt;std::string&gt; warningLog;</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span>    std::vector&lt;std::string&gt; errorLog;</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span>    std::vector&lt;std::string&gt; fatalLog;</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno">  138</span>};</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span> </div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclass_mag_logger_html"><div class="ttname"><a href="class_mag_logger.html">MagLogger</a></div><div class="ttdoc">MagLogger类用于记录日志信息.</div><div class="ttdef"><b>Definition</b> logger.h:12</div></div>
<div class="ttc" id="aclass_mag_logger_html_a463c08ad83b7ce61634ce61f2c653b2a"><div class="ttname"><a href="class_mag_logger.html#a463c08ad83b7ce61634ce61f2c653b2a">MagLogger::getAllLog</a></div><div class="ttdeci">std::vector&lt; std::string &gt; &amp; getAllLog()</div><div class="ttdoc">获取所有级别的日志信息数组.</div><div class="ttdef"><b>Definition</b> logger.h:122</div></div>
<div class="ttc" id="aclass_mag_logger_html_a46cb6161a2e36801ca084e93bc9d9f0c"><div class="ttname"><a href="class_mag_logger.html#a46cb6161a2e36801ca084e93bc9d9f0c">MagLogger::getInfoLog</a></div><div class="ttdeci">std::vector&lt; std::string &gt; &amp; getInfoLog()</div><div class="ttdoc">获取日志info级别的日志信息数组.</div><div class="ttdef"><b>Definition</b> logger.h:94</div></div>
<div class="ttc" id="aclass_mag_logger_html_a4dc582a17edb8e04890939de3be12880"><div class="ttname"><a href="class_mag_logger.html#a4dc582a17edb8e04890939de3be12880">MagLogger::error</a></div><div class="ttdeci">void error(const std::string &amp;message)</div><div class="ttdoc">记录error级别的日志信息.</div></div>
<div class="ttc" id="aclass_mag_logger_html_a7daa71a421f3faf8c8814d4e0e9b80cf"><div class="ttname"><a href="class_mag_logger.html#a7daa71a421f3faf8c8814d4e0e9b80cf">MagLogger::getDebugLog</a></div><div class="ttdeci">std::vector&lt; std::string &gt; &amp; getDebugLog()</div><div class="ttdoc">获取日志debug级别的日志信息数组.</div><div class="ttdef"><b>Definition</b> logger.h:87</div></div>
<div class="ttc" id="aclass_mag_logger_html_a871395cc8d7389bdf827cc610f3c236a"><div class="ttname"><a href="class_mag_logger.html#a871395cc8d7389bdf827cc610f3c236a">MagLogger::exportLog</a></div><div class="ttdeci">void exportLog(const std::string &amp;fileName)</div><div class="ttdoc">输出日志信息到文件.</div></div>
<div class="ttc" id="aclass_mag_logger_html_a8f2476196fafaf6bd65c9da863a7d059"><div class="ttname"><a href="class_mag_logger.html#a8f2476196fafaf6bd65c9da863a7d059">MagLogger::fatal</a></div><div class="ttdeci">void fatal(const std::string &amp;message)</div><div class="ttdoc">记录fatal级别的日志信息.</div></div>
<div class="ttc" id="aclass_mag_logger_html_a90b8b90bf5ac841eb406f74c015d72b3"><div class="ttname"><a href="class_mag_logger.html#a90b8b90bf5ac841eb406f74c015d72b3">MagLogger::getFatalLog</a></div><div class="ttdeci">std::vector&lt; std::string &gt; &amp; getFatalLog()</div><div class="ttdoc">获取日志fatal级别的日志信息数组.</div><div class="ttdef"><b>Definition</b> logger.h:115</div></div>
<div class="ttc" id="aclass_mag_logger_html_aa52e41fe1302a56ec26856cd062b291f"><div class="ttname"><a href="class_mag_logger.html#aa52e41fe1302a56ec26856cd062b291f">MagLogger::debug</a></div><div class="ttdeci">void debug(const std::string &amp;message)</div><div class="ttdoc">记录debug级别的日志信息.</div></div>
<div class="ttc" id="aclass_mag_logger_html_aa729d5403639328551ad7e2ec3f210e6"><div class="ttname"><a href="class_mag_logger.html#aa729d5403639328551ad7e2ec3f210e6">MagLogger::getErrorLog</a></div><div class="ttdeci">std::vector&lt; std::string &gt; &amp; getErrorLog()</div><div class="ttdoc">获取日志error级别的日志信息数组.</div><div class="ttdef"><b>Definition</b> logger.h:108</div></div>
<div class="ttc" id="aclass_mag_logger_html_ab2a8c008b8c2c0236fe45d7978600d7d"><div class="ttname"><a href="class_mag_logger.html#ab2a8c008b8c2c0236fe45d7978600d7d">MagLogger::getWarningLog</a></div><div class="ttdeci">std::vector&lt; std::string &gt; &amp; getWarningLog()</div><div class="ttdoc">获取日志warning级别的日志信息数组.</div><div class="ttdef"><b>Definition</b> logger.h:101</div></div>
<div class="ttc" id="aclass_mag_logger_html_abacc186e35e7a98e37edd8981c19454d"><div class="ttname"><a href="class_mag_logger.html#abacc186e35e7a98e37edd8981c19454d">MagLogger::warning</a></div><div class="ttdeci">void warning(const std::string &amp;message)</div><div class="ttdoc">记录warning级别的日志信息.</div></div>
<div class="ttc" id="aclass_mag_logger_html_ad13cbdf4b33a580b1096aee2aa9a4030"><div class="ttname"><a href="class_mag_logger.html#ad13cbdf4b33a580b1096aee2aa9a4030">MagLogger::~MagLogger</a></div><div class="ttdeci">~MagLogger()</div><div class="ttdoc">析构函数.</div><div class="ttdef"><b>Definition</b> logger.h:38</div></div>
<div class="ttc" id="aclass_mag_logger_html_adc2763b218ec03d8ecbb6bf00cc64a28"><div class="ttname"><a href="class_mag_logger.html#adc2763b218ec03d8ecbb6bf00cc64a28">MagLogger::info</a></div><div class="ttdeci">void info(const std::string &amp;message)</div><div class="ttdoc">记录info级别的日志信息.</div></div>
<div class="ttc" id="aclass_mag_logger_html_aeca59a7fe42b816420492621efd4cbb9"><div class="ttname"><a href="class_mag_logger.html#aeca59a7fe42b816420492621efd4cbb9">MagLogger::currentTime</a></div><div class="ttdeci">std::string currentTime()</div><div class="ttdoc">获取当前时间.</div></div>
<div class="ttc" id="aclass_mag_logger_html_af874833bef5967536c000746eed82900"><div class="ttname"><a href="class_mag_logger.html#af874833bef5967536c000746eed82900">MagLogger::MagLogger</a></div><div class="ttdeci">MagLogger()</div><div class="ttdoc">构造函数.</div><div class="ttdef"><b>Definition</b> logger.h:32</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>
